/*
 * SRM 170 Div 2 Prob 3
 */

import java.util.*;
import java.util.regex.*;
import java.text.*;
import java.math.*;


public class Poetry
{
    public boolean isSpaces (String str) {
	if (str == null || str.length() == 0)
	    return true;
	String[] sstr = str.split ("\\s+");
	return sstr == null || sstr.length == 0;
    }
    
    public boolean isVowel (String s, int i) {
	if ("aeoiu".indexOf (s.charAt (i)) >= 0)
	    return true;
	if (s.charAt (i) == 'y') {
	    if (i != 0 && i != s.length () - 1)
		return true;
	}
	return false;
    }
    
    public String getRytham (String str) {
	str = str.toLowerCase ();
	int i = str.length () - 1;
	while (i >= 0) {
	    char c = str.charAt (i);
	    if (isVowel (str, i))
		break;
	    --i;
	}
	
	if (i < 0) 
	    return str;
	if (i == 0)
	    return str;
	
	int j = i - 1;
	while (j >= 0) {
	    char c = str.charAt (j);
	    if (!isVowel (str, j))
		return str.substring (j+1);
	    --j;
	}
	/* j < 0*/
	return str;
    }

    public String rhymeScheme(String[] poem)
    {
	HashMap<String, Character> rythMap = new HashMap<String, Character> ();
	char cur = 'a';
	StringBuffer sb = new StringBuffer ("");
	for (String p:poem) {
	    if (isSpaces (p)) {
		sb.append (' ');
		continue;
	    }
	    String[] str = p.split ("\\s+");
	    String last = str[str.length - 1];
	    String ry = getRytham (last);
	    /*
	      if (ry.equals (" ")) {
	      sb.append (' ');
	      continue;
	      }
	    */
	    
	    if (rythMap.containsKey (ry)) {
		sb.append (rythMap.get (ry));
		continue;
	    }

	    rythMap.put (ry, cur);
	    sb.append (cur);
	    if (cur == 'z')
		cur = 'A';
	    else
		cur++;
	}
	return sb.toString ();
    }
    

}
//Powered by KawigiEdit 2.1.4 (beta) modified by pivanof!